<%@ page language="java" pageEncoding="UTF-8"%>

<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <meta name="Author" content="海文北海基地" />
	<meta name="keywords" content="生产管理系统--生产进度,设备管理,工艺监控,物料监控,人员监控,质量监控" />
	<meta name="description" content="海文制造装备物联及生产管理中间件/系统登陆页面" />
	<title>海文制造物联中间件系统登录页面</title>
    <%@ include file="/WEB-INF/jsp/common_js.jsp"%>
	<%@ include file="/WEB-INF/jsp/common_css.jsp"%>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
  </head>
  
  <body>
  	<div style="width:320px;height:600px;margin: 0 auto;margin-top: 250px;">
		<div class="easyui-panel" title="系统登录" style="width:300px;margin-left:auto;margin-right:auto;"> 
	        <form id="loginForm" action="" method="post"> 
	            <table style="margin: 15px auto;"> 
	                <tr style="height: 40px;"> 
	                    <td>用户名:</td> 
	                    <td><input name="username" type="text" value="${username}"></input></td> 
	                </tr> 
	                <tr style="height: 40px;"> 
	                    <td>密  码:</td> 
	                    <td><input name="password" type="password"  value="${password}"></input></td> 
	                </tr>
	                <tr style="height: 40px;"> 
	                    <td>验证码：</td> 
	                    <td>
	                    	<input name="code" type="text" style="width:100px;"></input>
	                   	 	<img id="code" alt="" src="${pageContext.request.contextPath}/code">
	                    </td> 
	                </tr> 
	                <tr style="height: 60px;"> 
	                    <td style="text-align: left;padding-left: 55px;" colspan="2"><input type="button" id="loginBtn" value="登    录"></input>${msg}</td> 
	                </tr> 
	            </table> 
	        </form> 
	    </div>
    </div>
	<script type="text/javascript">
		$(function(){
			var codeSrc=$("#code").attr("src");
			$("#code").click(function(){
				var t=new Date().getTime();
				this.src=codeSrc+"?t="+t;
			});
		});

		$("#loginBtn").click(function() {
			var datas=$("#loginForm").serialize();//表单数据项
			$.post("login",datas,
				function(data,state){
					if(data.msg=='success'){
						location.href="${baseurl}home";
					}else{
						$.messager.alert('信息提示',data.msg);
					}
				}
			);
		});
	</script>
  </body>
</html>
